package org.kommii.common_utils;

import java.util.UUID;

public class UUID_Sepuence {
	
	/**
	 * 获得一个指定长度的序列 长度: 1-32
	 * @param length
	 * @return
	 */
	public static String getUUIDSequ(int length){
		UUID uuid = UUID.randomUUID(); 
		String temp = uuid.toString();
		temp = temp.replace("-", "");
		int i = temp.length();
		if(i<length){
			length = i;
		}else if(length<1){
			length = 1;
		}
		temp = temp.substring(0,length);
		return temp;
	}
	
	public static void main(String[] args) {
		//String str = "1b134901-d537-4686-ab3e-18c97ff99635";
		System.out.println(getUUIDSequ(5));
	}

}
